/*
 * acm1797.c
 *
 *  Created on: 10 Apr 2010
 *      Author: xuxu
 */

#include<stdio.h>
long long gcd(long long a,long long b)
{
	int t;
	while(b)
	{
		t=b;
		b=a%b;
		a=t;
	}
	return a;
}
int main()
{
	long long num,n,count,i;
	long long result;
	scanf("%lld",&count);
	while(count--)
	{
		scanf("%lld",&n);
		result=1;
		for(i=0;i<n;i++)
		{
			scanf("%lld",&num);
			result=result*num/gcd(result>num?result:num,result>num?num:result);
		}
		printf("%lld\n",result);
	}
	return 0;
}
